const baseSize = 16;
const designSize = 1242;

const setRem = () => {
    const scale = document.documentElement.clientWidth / designSize;
    document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px';
};

export const initRem = () => {
    setRem();
    window.addEventListener('resize', () => {
        setRem();
    });
};
